/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package UI;

import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JOptionPane;

/**
 *
 * @author Marco
 */
public class lineacomponent extends JComponent implements MouseListener{

    private Color color = Color.RED;
    public void paintComponent(Graphics g){
       // super.paintComponent(g);
        g.setColor(Color.BLACK);
     
        g.drawLine(0, 0, 50,50 );
        this.setBackground(color);
       
        
        this.addMouseListener(this);
    }
    
    @Override
    public void mouseClicked(MouseEvent e) {
        this.setBackground(Color.red);
        JOptionPane.showMessageDialog(null, "feo");
    }
    @Override
    public void mousePressed(MouseEvent e) {
       
    }

    @Override
    public void mouseReleased(MouseEvent e) {
      
    }

    @Override
    public void mouseEntered(MouseEvent e) {
         
    }
    

    @Override
    public void mouseExited(MouseEvent e) {
       
    }
    
}
